using PKGames.Audio;
using Spine;

namespace PKGames
{
	public class SpineAudioEvent : SpineEventHandler
	{
		protected override void EventHandler(TrackEntry track, Event e)
		{
			if (e.Data.Name.Contains("play_sound") || e.Data.Name.Contains("sound://"))
			{
				string text = e.Data.String;
				int num = text.LastIndexOf(".");
				if (num > 0)
				{
					text = text.Remove(num);
				}
				MonoSingleton<AudioManager>.Instance.Play(text);
			}
		}
	}
}
